#include <sys/stat.h>
#include <nacl_stat.h>

void __nacl_abi_stat_to_stat (struct nacl_abi_stat *nacl_st,
                              struct stat *st)
{
  st->st_dev = nacl_st->nacl_abi_st_dev;
  st->st_mode = nacl_st->nacl_abi_st_mode;
  st->st_nlink = nacl_st->nacl_abi_st_nlink;
  st->st_uid = nacl_st->nacl_abi_st_uid;
  st->st_gid = nacl_st->nacl_abi_st_gid;
  st->st_rdev = nacl_st->nacl_abi_st_rdev;
  st->st_size = nacl_st->nacl_abi_st_size;
  st->st_blksize = nacl_st->nacl_abi_st_blksize;
  st->st_blocks = nacl_st->nacl_abi_st_blocks;
  // NACL MOD BEGIN
  // Field names are different.
  st->st_atime = nacl_st->nacl_abi_st_atime;
  st->st_atime_nsec = 0;
  st->st_mtime = nacl_st->nacl_abi_st_mtime;
  st->st_mtime_nsec = 0;
  st->st_ctime = nacl_st->nacl_abi_st_ctime;
  st->st_ctime_nsec = 0;
  // NACL MOD END
  st->st_ino = nacl_st->nacl_abi_st_ino;
}
